Skip to content

[Xamarin.Android.Build.Tasks] Fix an issue where the 'ref' nuget is not found on windows. - #1474

Merged
jonpryor merged 1 commit into
dotnet:masterfrom
dellis1972:fixreflookup
Mar 27, 2018
Merged

[Xamarin.Android.Build.Tasks] Fix an issue where the 'ref' nuget is not found on windows.#1474
jonpryor merged 1 commit into
dotnet:masterfrom
dellis1972:fixreflookup

Conversation

@dellis1972

@dellis1972 dellis1972 commented Mar 26, 2018

Copy link
Copy Markdown
Contributor

The previous commit 029a8b4 fixed up some issues with resolving
the correct nuget. However on windows we get some weird pathing
issues because the project.assets.json file is using / as
path seperators. This is probably to be platform independent.

So in the project.assets.json we have a PackageName of

System.IO.Packaging/4.4.0

note the use of the /.

But our string comparision was using what ever path we had, on
windows that was \.

c:\pathtonuget\system.io.packaging\4.4.0\ref\netstandard1.3\System.IO.Packaging.dll

So we never found the Library were we
looking for because system.io.packaging/4.4.0 != system.io.packaging\4.4.0.
We just got lucky that it worked on Mac because the path separator is /.

We also need to normalize the resulting full path
to match the system path separator, otherwise we end up looking for files like

c:\pathtonuget\system.io.packaging/4.4.0\lib\netstandard1.3/System.IO.Packaging.dll

which do not work.

…ot found on windows.

The previous commit 029a8b4 fixed up some issues with resolving
the correct nuget. However on windows we get some weird pathing
issues because the project.assets.json file is using `/` as
path seperators. This is probably to be platform independent.
But our string comparision was using what ever path we had, on
windows that was `\`. So we never found the Library were we
looking for. We also need to normalize the resulting full path
to match the system path separator.
@jonathanpeppers

Copy link
Copy Markdown
Member

I'm starting a Windows PR build for this one

@jonpryor
jonpryor merged commit 43fa142 into dotnet:master Mar 27, 2018
jonpryor pushed a commit that referenced this pull request Mar 27, 2018
The previous commit 029a8b4 fixed up some issues with resolving
the correct nuget. However on windows we get some weird pathing
issues because the project.assets.json file is using `/` as
path seperators. This is probably to be platform independent.

So in the project.assets.json we have a PackageName of

    System.IO.Packaging/4.4.0

note the use of the `/`.

But our string comparision was using what ever path we had, on
windows that was `\`:

    c:\pathtonuget\system.io.packaging\4.4.0\ref\netstandard1.3\System.IO.Packaging.dll

So we never found the Library were we
looking for because `system.io.packaging/4.4.0` != `system.io.packaging\4.4.0`.
We just got lucky that it worked on Mac because the path separator is `/`.

We also need to normalize the resulting full path
to match the system path separator, otherwise we end up looking for files like

    c:\pathtonuget\system.io.packaging/4.4.0\lib\netstandard1.3/System.IO.Packaging.dll

which do not work.
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants